package com.tedu.openmedical.medicalsystem.logininfo.controller;

import com.tedu.openmedical.base.response.JsonResult;
import com.tedu.openmedical.medicalsystem.logininfo.pojo.dto.LoginInfoQuery;
import com.tedu.openmedical.medicalsystem.logininfo.pojo.vo.LoginInfoVO;
import com.tedu.openmedical.medicalsystem.logininfo.service.LoginInfoService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@Slf4j
@Api(tags = "登录信息管理")
@RequestMapping("/v1/loginInfo/")
public class LoginInfoController {

    @Autowired
    private LoginInfoService loginInfoService;

    @GetMapping("select")
    @ApiOperation(value = "查询登录信息", notes = "根据登录信息ID查询登录信息")
    public JsonResult select(LoginInfoQuery query){
        log.debug("查询登录信息：{}", query);
        List<LoginInfoVO> loginInfoVOList = loginInfoService.select(query);
        return JsonResult.ok(loginInfoVOList);
    }
}
